#define  _CRT_SECURE_NO_WARNINGS 1	
#include<stdio.h>
#include<assert.h>
char* my_strncpy(char* str, const char* arr, size_t sz)
{
	assert(str && arr);
	char* ret = str;
	while (sz--)
	{
		*str++ = *arr++;
		*str = '\0';
	}
	return ret;
}
int main()
{
	char arr[] = { "abcdef" };
	char str[10] = { 0 };
	char* ret = my_strncpy(str, arr, 3);
	printf("%s", ret);
	return 0;
}